//
//  XZLForumPostTitleAttachment.m
//  XZLife
//
//  Created by liangshangjia on 15/12/23.
//  Copyright (c) 2015年 Sami-industry. All rights reserved.
//

#import "XZLCustomTextAttachment.h"
#import "MainConfigure.h"
#define kTitle_height SM_SIZE(40.f)

@implementation XZLCustomTextAttachment
- (CGRect)attachmentBoundsForTextContainer:(NSTextContainer *)textContainer proposedLineFragment:(CGRect)lineFrag glyphPosition:(CGPoint)position characterIndex:(NSUInteger)charIndex
{
    return CGRectMake( 0, -self.height/4 , self.image.size.width/self.image.size.height * self.height, self.height);
}


- (CGFloat)height
{
    if (!_height) {
        _height = kTitle_height;
    }
    return _height;
}
@end
